package com.lv.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lv.common.dto.UserList;
import com.lv.entity.Role;
import com.lv.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 凉薄
 * @since 2022-01-06
 */
public interface UserService extends IService<User> {
    User getByName(String username);

    String getUserAuthorities(Long id);
    //当用户退出 用户角色发生变化 角色名称发生变化 菜单权限发生变化 都要清除
    void clearAuthoritiesInfo(Long id);
    @Transactional
    void deleteUser(Long id);
    @Transactional
    void updateRole(Long userId,Long roleId);
    IPage<UserList> getAll(Integer current, Integer pageSize, String username);
}
